package cn.bitkit.component.log;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.filter.ValueFilter;

/**
 * @author changbo
 */
public class LogUtil {

	private static final ValueFilter SENSITIVE = new LogSensitiveFilter();
	private static final ValueFilter SIMPLIFY = new LogSimplifyFilter();

	public static String json(Object obj) {
		if(obj == null) {
			return null;
		}
		ValueFilter filter = ValueFilter.compose(SIMPLIFY, SENSITIVE);
        return JSON.toJSONString(obj, filter);
	}

}
